import { IPSAppView } from '../../app/view/ipsapp-view';
import { IPSDEMultiEditViewPanel } from './ipsdemulti-edit-view-panel';
import { PSDEGridImpl } from './psdegrid-impl';

export class PSDEMultiEditViewPanelImpl extends PSDEGridImpl implements IPSDEMultiEditViewPanel {
  protected embeddedpsappview: IPSAppView | null = null;

  getEmbeddedPSAppView(): IPSAppView | null {
    if (this.embeddedpsappview != null) return this.embeddedpsappview;
    const value = this.M.getEmbeddedPSAppView;
    if (value == null) {
      return null;
    }
    this.embeddedpsappview = this.getPSModel4('app.view.IPSAppView', value, 'getEmbeddedPSAppView') as IPSAppView;
    return this.embeddedpsappview;
  }

  get embeddedPSAppView(): IPSAppView | null {
    return this.getEmbeddedPSAppView();
  }

  getEmbeddedPSAppViewMust(): IPSAppView {
    const value = this.getEmbeddedPSAppView();
    if (value == null) {
      throw new Error('未指定嵌入应用视图');
    }
    return value;
  }

  get panelStyle(): string {
    return this.M.panelStyle;
  }

  get cls(): string {
    return 'PSDEMultiEditViewPanelImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.grid.IPSDEMultiEditViewPanel') return true;
    return super.instanceof(cls);
  }
}
